package com.xxq.semester.service.impl.classmgmt;

import com.xxq.semester.entity.classmgmt.ClassStudents;
import com.xxq.semester.entity.classmgmt.ClassTeachers;
import com.xxq.semester.mapper.ClassTeachersMapper;
import com.xxq.semester.service.classmgmt.IClassTeachersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xxq.semester.entity.classmgmt.Classes;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author saki
 * @since 2025-07-13
 */
@Service
@RequiredArgsConstructor
public class ClassTeachersServiceImpl extends ServiceImpl<ClassTeachersMapper, ClassTeachers> implements IClassTeachersService {
    @Autowired
    private ClassTeachersMapper classTeachersMapper;
    @Override
    public Boolean createClass(String classname,String description,Integer teacherId) {
        return classTeachersMapper.createClass(classname, description, teacherId);
    }
    @Override
    public Boolean deleteClass(Integer classId) {
        return classTeachersMapper.deleteClass(classId);
    }
    @Override
    public List<Classes> getAllClassesByTeachersId(Integer teacherId) {
        return classTeachersMapper.getAllClassesByTeachersId(teacherId);
    }
    @Override
    public Boolean inviteStudent(Integer classId,Integer studentId) {
        return classTeachersMapper.inviteStudent(classId, studentId);
    }
    @Override
    public Integer inviteStudentByInviteCode(String classname) {
        return classTeachersMapper.inviteStudentByInviteCode(classname);
    }
    @Override
    public List<ClassStudents> getClassStudentsByClassId(Integer classId) {
        return classTeachersMapper.getClassStudentsByClassId(classId);
    }
}
